//
//  LXUserInfo.m
//  bgms_p
//
//  Created by xiao.zhao@lachesis-mh.com on 16/3/7.
//  Copyright © 2016年 xiao.zhao@lachesis-mh.com. All rights reserved.
//

#import "LXUserInfo.h"

@implementation LXUserInfo
@synthesize token = _token, telephone = _telephone;

+(LXUserInfo *)shareInstance
{
    static LXUserInfo *userInfo;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        userInfo = [[LXUserInfo alloc]init];
    });
    
    return userInfo;
}

+ (NSDictionary *)modelContainerPropertyGenericClass
{
    return @{@"mobiles" : [NSString class]};
}

-(void)setToken:(NSString *)token
{
    if(_token != token)
    {
        _token = token;
        
        [self saveObject:_token forKey:kLXUserTokenKey];
    }
}

-(NSString *)token
{
    if(_token) return _token;
    
    return [self getObjectForKey:kLXUserTokenKey];
}

//-(instancetype)initWithCoder:(NSCoder *)aDecoder
//{
//    if(self = [super init])
//    {
//        self = [self yy_modelInitWithCoder:aDecoder];
//    }
//    
//    return self;
//}
//
//-(void)encodeWithCoder:(NSCoder *)aCoder
//{
//    return [self yy_modelEncodeWithCoder:aCoder];
//}

@end
